<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>判断参数非空</title>
</head>
<body>
<script>
    //es5
    var x=function(x,y){
        return x*y;
    }
    console.log("x:"+x(1,2));
    //es6
    //var y = (x,y)=>{return x*y;}
    var y= (x,y)=>x*y;
    console.log("y:"+y(2,2));//只针对有返回值
    function add(x,y=10){
        return x+y;
    }
    var res=add(1,2);
    var resb = add(1);
    console.log(res);
    console.log(resb);



</script>
</body>
</html>